package socket;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    private ServerSocket serverScoket;
    public Server() {
        try {
            System.out.println("正在启动服务器...");
            serverScoket = new ServerSocket(8088);
            System.out.println("服务器启动完毕");
        }catch (IOException e){
            e.printStackTrace();
        }
    }
    public void start(){
        try {
            System.out.println("等待客户端链接...");
            Socket socket = serverScoket.accept();
            System.out.println("一个客户端链接了");
        }catch (IOException e){
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        Server server = new Server();
        server.start();
    }
}
